//
//  UIView+Label.m
//  cashloanApp
//
//  Created by mac on 2019/3/13.
//  Copyright © 2019年 WeiLian. All rights reserved.
//

#import "UIView+Create.h"

@implementation UILabel (Create)
+(UILabel *)createLabelText:(NSString*)text font:(UIFont *)font textColor:(UIColor *)color {
    UILabel* label = [[self alloc] init];
    label.text = text;
    label.font = font;
    label.textColor = color;
    return label;
}
+(UILabel *)createLabelFont:(UIFont *)font textColor:(UIColor *)color alignment:(NSTextAlignment)alignment {
    UILabel* label = [[self alloc] init];
    label.font = font;
    label.textColor = color;
    label.textAlignment = alignment;
    return label;
}
@end

@implementation UIButton (Create)
+(UIButton *)createButtonText:(NSString*)text font:(UIFont *)font textColor:(UIColor *)color {
    UIButton* button = [[self alloc] init];
    [button setTitle:text forState:UIControlStateNormal];
    [button setTitleColor:color forState:UIControlStateNormal];
    button.titleLabel.font = font;
    return button;
}
+(UIButton *)createButtonImage:(NSString*)imageName {
    UIButton* button = [[self alloc] init];
    [button setImage:[UIImage imageNamed:imageName] forState:UIControlStateNormal];
    return button;
}

@end
